package com.hfzy.ihk.facade.linkcall.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**未识别问题来源类型
 * @Auther: Administrator
 * @Date: 2019/1/3 11:10
 * @Description:
 */
public enum QuestionSourceType implements CustomEnumType {

    CALL_RECORDS("callRecords","通话记录"),

    APP_TRAINING("appTraining","小程序训练");

    private String value;

    private String desc;

    QuestionSourceType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, QuestionSourceType> map = new HashMap<>();
    static {
        for (QuestionSourceType value : QuestionSourceType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static QuestionSourceType fromValue(String value) {
        QuestionSourceType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + QuestionSourceType.class + "." + value);
        }
    }

}
